import { Player } from "../Player/Player"

// 角色数据类型
type PlayerData = {
    name: string,
    maxHp: number,  // 最大生命值 100
    speed: number, // 移动速度 2
    img: string, // 角色图片
    attack: number, // 攻击力 25
    attackSpeed: number, // 攻击速度 .5
}
// 角色数据
export const PlayerData: Record<number, PlayerData> = {
    1: {
        name: "卤蛋",
        maxHp: 100,
        speed: 4,
        img: "role1",
        attack: 45,
        attackSpeed: .5,
    },
    2: {
        name: "小美",
        maxHp: 100,
        speed: 4,
        img: "role2",
        attack: 40,
        attackSpeed: .5,
    },
    3: {
        name: "黄毛",
        maxHp: 100,
        speed: 4,
        img: "role3",
        attack: 100,
        attackSpeed: .3,
    },
    4: {
        name: "英俊",
        maxHp: 120,
        speed: 4,
        img: "role4",
        attack: 40,
        attackSpeed: .5,
    }
}

/**
 * 根据角色id获取角色数据
 * @param id 角色id
 * @returns 角色数据
 */
export const getPlayerData = (id: string | number): PlayerData => {
    return PlayerData[id]
}